package org.hgvc.webapp.ets.jsf.beans;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import org.hgvc.webapp.ets.constant.AdminConstant;
import org.hgvc.webapp.ets.constant.AgentConstant;
import org.hgvc.webapp.ets.constant.PartnerConstant;
import org.jocsb.base.AbstractBean;
import org.jocsb.base.util.SpringUtils;



public class DemoBean extends AbstractBean {

	private List<DemoObj> list;
	private List<DemoObj> partnerList;
	private List<DemoObj> adminList;
	private List<DemoObj> agentList;
	private String value = "Prototype Value";
	private List<DemoObj> valueList;
	
	public String submitNonMemberOrderAction(){
		return AdminConstant.NAV_STATUS_SUCCESS;
	}
	
	public String submitOrderAction(){
		return AdminConstant.NAV_STATUS_SUCCESS;
	}
	
	public List<DemoObj> getProductList() {
		list = new ArrayList<DemoObj>();
		list.add(new DemoObj(new Date(), "SRHPJ","Sunway Resort Hotel - PJ"));
		list.add(new DemoObj(new Date(),"HINNKL","Transport Services"));
		list.add(new DemoObj(new Date(),"HINNMYY","Restaurant"));
		
		return list;
	}

	public List<DemoObj> getList() {
		list = new ArrayList<DemoObj>();
		list.add(new DemoObj(new Date(),"Welcome to E-Timeshare System"));
		list.add(new DemoObj(new Date(),"New Individual Member has registred ref no:#1234567890 "));
		return list;
	}

	public void setList(List<DemoObj> list) {
		this.list = list;
	}

	public List<DemoObj> getPartnerList() {
		partnerList = new ArrayList<DemoObj>();
		partnerList.add(new DemoObj(new Date()
				,SpringUtils.getMessage(PartnerConstant.ACTION_BULLETIN_PARTNER_REG_SUCCESS
				,new Object[]{"P00001"}),"partnerDemoCalendarMgmt"));
		return partnerList;
	}

	public void setPartnerList(List<DemoObj> partnerList) {
		this.partnerList = partnerList;
	}

	public List<DemoObj> getAdminList() {
		adminList = new ArrayList<DemoObj>();
		adminList.add(new DemoObj(new Date()
				,SpringUtils.getMessage(PartnerConstant.ACTION_BULLETIN_PARTNER_REG_PENDING_APPROVAL
				,new Object[]{"P1234567890"}),"partnerDemoApproval"));
		adminList.add(new DemoObj(new Date()
		,SpringUtils.getMessage(AgentConstant.ACTION_BULLETIN_AGENT_REG_PENDING_APPROVAL
		,new Object[]{"A1234567890"}),"adminDemoApproval"));
		return adminList;
	}

	public void setAdminList(List<DemoObj> adminList) {
		this.adminList = adminList;
	}

	public List<DemoObj> getAgentList() {
		agentList = new ArrayList<DemoObj>();
		agentList.add(new DemoObj(new Date()
				,SpringUtils.getMessage(AgentConstant.ACTION_BULLETIN_AGENT_REG_SUCCESS
				,new Object[]{"A00001"}),"subAgentMgmt"));
		return agentList;
	}

	public void setAgentList(List<DemoObj> agentList) {
		this.agentList = agentList;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public List<DemoObj> getValueList() {
		valueList = new ArrayList<DemoObj>();
		for(int i = 0;i<5;i++){
			DemoObj obj = new DemoObj();
			valueList.add(obj);
		}
		
		return valueList;
	}

	public void setValueList(List<DemoObj> valueList) {
		this.valueList = valueList;
	}
	
}
